// DlgBRDFRendering.cpp : implementation file
//

#include "stdafx.h"
#include "MFCD3D11Test.h"
#include "DlgBRDFRendering.h"
#include "afxdialogex.h"


// CDlgBRDFRendering dialog

IMPLEMENT_DYNAMIC(CDlgBRDFRendering, CDialogEx)

CDlgBRDFRendering::CDlgBRDFRendering(CWnd* pParent /*=NULL*/)
	: CDialogEx(CDlgBRDFRendering::IDD, pParent)
{

}

CDlgBRDFRendering::~CDlgBRDFRendering()
{
}

void CDlgBRDFRendering::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDlgBRDFRendering, CDialogEx)
	ON_WM_CREATE()
	ON_WM_SIZE()
	ON_WM_SETFOCUS()
END_MESSAGE_MAP()


// CDlgBRDFRendering message handlers


int CDlgBRDFRendering::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialogEx::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  Add your specialized creation code here
#define  ID_TMP2  144446
	m_Render.Create(NULL, NULL, WS_CHILD|WS_VISIBLE, CRect(0,0,10,10), this, ID_TMP2);

	CRect rcClient;
	GetClientRect(&rcClient);
	rcClient.DeflateRect(0,0,0,40);
	m_Render.MoveWindow(0,0,rcClient.Width(), rcClient.Height()-40, FALSE);

	return 0;
}


void CDlgBRDFRendering::OnSize(UINT nType, int cx, int cy)
{
	CDialogEx::OnSize(nType, cx, cy);

	// TODO: Add your message handler code here
	if(m_Render.GetSafeHwnd() && nType != SIZE_MINIMIZED)
	{
		m_Render.SetWindowPos(&CWnd::wndTop, 0, 0, cx, cy-40, SWP_NOMOVE);
	}
}


void CDlgBRDFRendering::OnSetFocus(CWnd* pOldWnd)
{
	CDialogEx::OnSetFocus(pOldWnd);

	// TODO: Add your message handler code here
	if(m_Render.GetSafeHwnd())
		m_Render.SetFocus();
}
